<?php
namespace User\Controller;
use Think\Controller;
use Think\Page;
use User\Model\FactoryModel;
use User\Model\MemberClassModel;
use User\Model\MemberItemCardModel;
use User\Model\MemberModel;
use User\Model\MemberPropertyModel;
use User\Model\MemberServiceItemModel;
use User\Model\MemberServiceModel;

class MemberController extends UserController
{
    public function __construct()
    {
        parent::__construct();
        if( !headers_sent() && // 如果页面头部信息还没有输出
            extension_loaded("zlib") && // 而且php已经加载了zlib扩展
            strstr($_SERVER["HTTP_ACCEPT_ENCODING"],"gzip")) //而且浏览器接受GZIP
        {
            ini_set('zlib.output_compression', 'On');
            ini_set('zlib.output_compression_level', '4');
        }
    }

    public function index()
    {
        $cond['status'] = array("NEQ", MemberModel::STATUS_DELETE);
        $cond['token'] = $this->wxuser['token'];

        $count = M("member")->where($cond)->count();

        $page = new Page($count, 10);
        $show = $page->show();
        $this->assign("page", $show);

        $list = M("member")->where($cond)->limit($page->firstRow . ',' . $page->listRows)->order('member_id desc')->select();
        $this->assign("list", $list);

        $member_class_arr = array();
        $region_arr = array();
        foreach ($list as $val) {
            $member_class_arr[] = $val['class_id'];
            $region_arr[] = $val['province'];
            $region_arr[] = $val['city'];
            $region_arr[] = $val['district'];
        }
        $member_class_arr = array_unique($member_class_arr);
        $member_class_arr = array_values($member_class_arr);
        $member_class = array();
        if (!empty($member_class_arr)) {
            $cond_class['class_id'] = array('IN', $member_class_arr);
            $member_class = M("member_class")->where($cond_class)->getField('class_id,name');
        }

        $this->assign('member_class', $member_class);
        $region_arr = array_unique($region_arr);
        $region_arr = array_values($region_arr);
        $region = array();
        if (!empty($region_arr)) {
            $cond_region['id'] = array('IN', $region_arr);
            $region = M("region")->where($cond_region)->getField('id,regionname');
        }
        $this->assign('region', $region);
        $this->display();
    }

    public function memberAdd()
    {
        $params = I("post.", "", "");
        if (empty($params)) {
            $type = 'add';
            $this->assign('type', $type);
            $this->get_public_info();
            return $this->display('memberUpdate');
        }
        if (empty($params['name'])) {
            return $this->redirect("/User/Member/index");
        }
        $data['name'] = $params['name'];
        $data['class_id'] = $params['class_id'];
        $data['province'] = $params['province'];
        $data['city'] = $params['city'];
        $data['district'] = $params['district'];
        $data['address'] = I("post.address", "", "");
        $data['phone'] = $params['phone'];
        $data['channel'] = MemberModel::CHANNEL_SYS;
        $data['token'] = $this->wxuser['token'];
        $data['status'] = MemberModel::STATUS_ACTIVE;

        $img = $this->upload(",");
        $cond_class['class_id'] = $data['class_id'];
        $member_class = M("member_class")->where($cond_class)->find();
        if (!empty($member_class)) {
            $propertys = $member_class['property_ids'];
            $cond_property['property_id'] = array("IN", explode(",", $propertys));
            $cond_property['status'] = MemberPropertyModel::STATUS_ACTIVE;
            $property_needs = M("member_property")->where($cond_property)->select();
            foreach ($property_needs as $property_need) {
                if (isset($params[$property_need['property_id']])) {
                    $data['ext'] .= $property_need['property_id'] . "|" . $params[$property_need['property_id']] . ",";
                }
                if (array_key_exists($property_need['property_id'], $img)) {
                    $data['ext'] .= $property_need['property_id'] . "|" . $img[$property_need['property_id']] . ",";
                }
            }
        }

        M("member")->add($data);
        return $this->redirect("/User/Member/index");
    }

    public function memberUpdate()
    {
        $type = I("get.type", "", "");
        $memberId = I("get.memberId", "", "");
        $params = I("post.", "", "");
        if ($type == 'update' && empty($params)) {
            $member = M("member")->where(['member_id' => $memberId])->find();
            $this->assign("member", $member);
            if (!empty($member)) {
                $this->assign("exist_ext", $member['ext']);
            }
            $this->get_public_info();

            if (!empty($member)) {
                $cond['id'] = $member['province'];
                $provinceobj = M("region")->where($cond)->find();
                if (!empty($provinceobj)) {
                    $this->assign("exist_province", $provinceobj['regionname']);
                }

                $cond['id'] = $member['city'];
                $cityobj = M("region")->where($cond)->find();
                if (!empty($cityobj)) {
                    $this->assign("exist_city", $cityobj['regionname']);
                }

                $cond['id'] = $member['district'];
                $district = M("region")->where($cond)->find();
                if (!empty($district)) {
                    $this->assign("exist_district", $district['regionname']);
                }
            }

            return $this->display();
        }
        $memberId = I("post.memberId", "", "");
        if (empty($memberId)) {
            return $this->redirect("/User/Member/index");
        }
        if (empty($params['name'])) {
            return $this->redirect("/User/Member/index");
        }
        $data['name'] = $params['name'];
        $data['class_id'] = $params['class_id'];
        $data['province'] = $params['province'];
        $data['city'] = $params['city'];
        $data['district'] = $params['district'];
        $data['address'] = I("post.address", "", "");
        $data['phone'] = $params['phone'];
        $data['channel'] = MemberModel::CHANNEL_SYS;
        $data['token'] = $this->wxuser['token'];
        $data['status'] = MemberModel::STATUS_ACTIVE;
        $img = $this->upload(",");
        $cond_class['class_id'] = $data['class_id'];
        $member_class = M("member_class")->where($cond_class)->find();
        if (!empty($member_class)) {
            $propertys = $member_class['property_ids'];
            $cond_property['property_id'] = array("IN", explode(",", $propertys));
            $cond_property['status'] = MemberPropertyModel::STATUS_ACTIVE;
            $property_needs = M("member_property")->where($cond_property)->select();
            foreach ($property_needs as $property_need) {
                if (isset($params[$property_need['property_id']])) {
                    $data['ext'] .= $property_need['property_id'] . "|" . $params[$property_need['property_id']] . ",";
                }
                if (array_key_exists($property_need['property_id'], $img)) {
                    $data['ext'] .= $property_need['property_id'] . "|" . $img[$property_need['property_id']] . ",";
                }
            }
        }
        M("member")->where(['member_id' => $memberId])->save($data);
        return $this->redirect("/User/Member/index");
    }

    public function get_public_info()
    {
        $cond_class['token'] = $this->wxuser['token'];
        $cond_class['status'] = MemberClassModel::STATUS_ACTIVE;
        $member_class = M("member_class")->where($cond_class)->select();
        $this->assign('member_class', $member_class);

        $cond_province['regiontype'] = 1;
        $province = M("region")->where($cond_province)->select();
        $this->assign('province', $province);

    }

    public function memberActive()
    {
        $memberId = I("get.memberId", "", "");
        $data['status'] = MemberModel::STATUS_ACTIVE;
        if (!empty($memberId)) {
            M("member")->where(['member_id' => $memberId])->save($data);
        }
        return $this->my_success("成功");
    }

    public function memberDelete()
    {
        $memberId = I("get.memberId", "", "");
        $data['status'] = MemberModel::STATUS_DELETE;
        if (!empty($memberId)) {
            M("member")->where(['member_id' => $memberId])->save($data);
        }
        return $this->my_success("成功");
    }

    public function city()
    {
        $cond_city['parentid'] = I("get.province", "", "");
        if (!empty($cond_city['parentid']) && $cond_city['parentid'] != '-') {
            $city = M("region")->where($cond_city)->select();
            echo json_encode($city);
        } else {
            echo "";
        }

    }

    public function district()
    {
        $cond_district['parentid'] = I("get.city", "", "");
        if (!empty($cond_district['parentid']) && $cond_district['parentid'] != '-') {
            $district = M("region")->where($cond_district)->select();
            echo json_encode($district);
        } else {
            echo "";
        }

    }

    public function ext()
    {
        $cond['service_id'] = I("get.class_id", "", "");
        if (!empty($cond['service_id']) && $cond['service_id'] != '-') {
            $cond['status'] = MemberClassModel::STATUS_ACTIVE;
            $class = M("member_class")->where($cond)->find();
            if (!empty($class)) {
                $exts = array();
                foreach (explode(",", $class['property_ids']) as $property) {
                    $cond['property_id'] = $property;
                    $ext = M("member_property")->where($cond)->find();
                    if (!empty($ext)) {
                        $exts[] = $ext;
                    }
                }
                echo json_encode($exts);
            }

        } else {
            echo "";
        }
    }

    public function memberClass()
    {
        $cond['status'] = MemberClassModel::STATUS_ACTIVE;
        $cond['token'] = $this->wxuser['token'];

        $count = M("member_class")->where($cond)->count();

        $page = new Page($count, 10);
        $show = $page->show();

        $list = M("member_class")->where($cond)->limit($page->firstRow . ',' . $page->listRows)->order('class_id desc')->select();

        $this->assign("page", $show);
        $this->assign("list", $list);
        $this->display();
    }

    public function classAdd()
    {
        $params = I("post.", "", "");
        if (empty($params)) {
            $type = 'add';
            $this->assign('type', $type);
            $cond['status'] = MemberServiceModel::STATUS_ACTIVE;
            $cond['token'] = $this->wxuser['token'];
            $member_service = M("member_service")->where($cond)->select();
            $this->assign('member_service', $member_service);

            $cond['status'] = MemberPropertyModel::STATUS_ACTIVE;
            $cond['token'] = $this->wxuser['token'];
            $member_property = M("member_property")->where($cond)->select();
            $this->assign('member_property', $member_property);
            return $this->display('classUpdate');
        }
        if (empty($params['name'])) {
            return $this->my_error("请填写会员类型名称");
        }

        $data['name'] = $params['name'];
        $data['need_pay_money'] = empty($params['need_pay_money']) ? 0 : $params['need_pay_money'];
        $data['pay_cycle'] = empty($params['pay_cycle']) ? 0 : $params['pay_cycle'];
        $data['pay_cycle_unit'] = $params['pay_cycle_unit'];
        $data['status'] = MemberClassModel::STATUS_ACTIVE;
        $data['need_check'] = empty($params['need_check']) ? 1 : $params['need_check'];
        $data['token'] = $this->wxuser['token'];
        $data['service_ids'] = empty($params['service_ids']) ? '' : $params['service_ids'];
        $data['property_ids'] = empty($params['property_ids']) ? '' : $params['property_ids'];
        $img = $params['picurl'];
        $ajaxImg = FactoryModel::ajaxImgUpload($img, "member");
        if ($ajaxImg['code'] != 1) {
            return $this->my_error($ajaxImg['msg']);
        }
        $data['picurl'] = $ajaxImg['msg'];
        M("member_class")->add($data);
        return $this->my_success("成功");
    }

    public function classUpdate()
    {
        $type = I("get.type", "", "");
        $classId = I("get.classId", "", "");
        if ($type == 'update') {
            $member_class = M("member_class")->where(['class_id' => $classId])->find();
            $exist_service_ids = array();
            if (!empty($member_class)) {
                $exist_service_ids = explode(',', $member_class['service_ids']);
            }
            $exist_property_ids = array();
            if (!empty($member_class)) {
                $exist_property_ids = explode(',', $member_class['property_ids']);
            }
            $this->assign("member_class", $member_class);
            $this->assign("exist_service_ids", $exist_service_ids);
            $this->assign("exist_property_ids", $exist_property_ids);

            $cond['status'] = MemberServiceModel::STATUS_ACTIVE;
            $cond['token'] = $this->wxuser['token'];
            $member_service = M("member_service")->where($cond)->select();
            $this->assign('member_service', $member_service);

            $cond['status'] = MemberPropertyModel::STATUS_ACTIVE;
            $cond['token'] = $this->wxuser['token'];
            $member_property = M("member_property")->where($cond)->select();
            $this->assign('member_property', $member_property);
            return $this->display();
        }

        $params = I("post.", "", "");
        if (empty($params['classId'])) {
            return $this->my_error("请返回上一页重新选择");
        }
        if (empty($params['name'])) {
            return $this->my_error("请填写会员类型名称");
        }

        $data['name'] = $params['name'];
        $data['need_pay_money'] = empty($params['need_pay_money']) ? 0 : $params['need_pay_money'];
        $data['pay_cycle'] = empty($params['pay_cycle']) ? 0 : $params['pay_cycle'];
        $data['pay_cycle_unit'] = $params['pay_cycle_unit'];
        $data['need_check'] = empty($params['need_check']) ? 1 : $params['need_check'];
        $data['token'] = $this->wxuser['token'];
        $data['service_ids'] = empty($params['service_ids']) ? '' : $params['service_ids'];
        $data['property_ids'] = empty($params['property_ids']) ? '' : $params['property_ids'];
        $img = $params['picurl'];
        if (!empty($img)) {
            $ajaxImg = FactoryModel::ajaxImgUpload($img, "member");
            if ($ajaxImg['code'] != 1) {
                return $this->my_error($params['picurl']);
            }
            $data['picurl'] = $ajaxImg['msg'];
        }
        M("member_class")->where(['class_id' => $params['classId']])->save($data);
        return $this->my_success("成功");
    }

    public function classDelete()
    {
        $classId = I("get.classId", "", "");
        $data['status'] = MemberClassModel::STATUS_DELETE;
        if (!empty($classId)) {
            M("member_class")->where(['class_id' => $classId])->save($data);
        }
        return $this->my_success("成功");
    }

    public function service()
    {
        $cond['status'] = MemberServiceModel::STATUS_ACTIVE;
        $cond['token'] = $this->wxuser['token'];

        $count = M("member_service")->where($cond)->count();

        $page = new Page($count, 10);
        $show = $page->show();

        $list = M("member_service")->where($cond)->limit($page->firstRow . ',' . $page->listRows)->order('service_id desc')->select();

        $this->assign("page", $show);
        $this->assign("list", $list);
        $this->display();
    }

    public function serviceAdd()
    {
        $params = $_GET;
        if (empty($params)) {
            $type = 'add';
            $this->assign('type', $type);
            return $this->display('serviceUpdate');
        }
        if (empty($params['name'])) {
            return $this->my_error("请填写服务名称");
        }
        $data['name'] = $params['name'];
        $data['status'] = MemberServiceModel::STATUS_ACTIVE;
        $data['token'] = $this->wxuser['token'];

        M("member_service")->add($data);
        return $this->my_success("成功");
    }

    public function serviceUpdate()
    {
        $type = I("get.type", "", "");
        $serviceId = I("get.serviceId", "", "");
        if ($type == 'update') {
            $member_service = M("member_service")->where(['service_id' => $serviceId])->find();
            $this->assign("member_service", $member_service);
            return $this->display();
        }
        if (empty($serviceId)) {
            return $this->my_error("请返回上一页重新选择");
        }
        $params = I("get.", "", "");
        if (empty($params['name'])) {
            return $this->my_error("请填写服务名称");
        }
        $data['name'] = $params['name'];
        $data['token'] = $this->wxuser['token'];
        M("member_service")->where(['service_id' => $serviceId])->save($data);
        return $this->my_success("成功");
    }

    public function serviceDelete()
    {
        $serviceId = I("get.serviceId", "", "");
        $data['status'] = MemberServiceModel::STATUS_DELETE;
        if (!empty($serviceId)) {
            M("member_service")->where(['service_id' => $serviceId])->save($data);
        }
        return $this->my_success("成功");
    }

    public function serviceSelect()
    {
        $service = trim(I("get.service", "", ""));
        $member_service = '';
        if (!empty($service)) {
            $where['name'] = array("LIKE", "%" . $service . "%");
            $where['status'] = MemberServiceModel::STATUS_ACTIVE;
            $member_service = M("member_service")->where($where)->limit(20)->getField('service_id,name');
        } else {
            $where['status'] = MemberServiceModel::STATUS_ACTIVE;
            $member_service = M("member_service")->where($where)->limit(20)->getField('service_id,name');
        }
        echo json_encode($member_service);
    }

    public function property()
    {
        $cond['status'] = MemberPropertyModel::STATUS_ACTIVE;
        $cond['token'] = $this->wxuser['token'];

        $count = M("member_property")->where($cond)->count();

        $page = new Page($count, 10);
        $show = $page->show();

        $list = M("member_property")->where($cond)->limit($page->firstRow . ',' . $page->listRows)->order('property_id desc')->select();

        $this->assign("page", $show);
        $this->assign("list", $list);
        $this->display();
    }

    public function propertyAdd()
    {
        $params = $_GET;
        if (empty($params)) {
            $type = 'add';
            $this->assign('type', $type);
            return $this->display('propertyUpdate');
        }
        if (empty($params['name'])) {
            return $this->my_error("请填写属性名称");
        }
        $data['name'] = $params['name'];
        $data['status'] = MemberPropertyModel::STATUS_ACTIVE;
        $data['style'] = empty($params['style']) ? 0 : $params['style'];
        $data['format'] = empty($params['format']) ? 0 : $params['format'];
        $data['token'] = $this->wxuser['token'];

        M("member_property")->add($data);
        return $this->my_success("成功");
    }

    public function propertyUpdate()
    {
        $type = I("get.type", "", "");
        $propertyId = I("get.propertyId", "", "");
        if ($type == 'update') {
            $member_property = M("member_property")->where(['property_id' => $propertyId])->find();
            $this->assign("member_property", $member_property);
            return $this->display();
        }
        if (empty($propertyId)) {
            return $this->my_error("请返回上一页重新选择");
        }
        $params = I("get.", "", "");
        if (empty($params['name'])) {
            return $this->my_error("请填写属性名称");
        }
        $data['name'] = $params['name'];
        $data['status'] = MemberPropertyModel::STATUS_ACTIVE;
        $data['style'] = empty($params['style']) ? 0 : $params['style'];
        $data['format'] = empty($params['format']) ? 0 : $params['format'];
        $data['token'] = $this->wxuser['token'];
        M("member_property")->where(['property_id' => $propertyId])->save($data);
        return $this->my_success("成功");
    }

    public function propertyDelete()
    {
        $propertyId = I("get.propertyId", "", "");
        $data['status'] = MemberPropertyModel::STATUS_DELETE;
        if (!empty($propertyId)) {
            M("member_property")->where(['property_id' => $propertyId])->save($data);
        }
        return $this->my_success("成功");
    }

    public function item()
    {
        $cond['status'] = MemberServiceItemModel::STATUS_ACTIVE;
        $cond['token'] = $this->wxuser['token'];

        $count = M("member_service_item")->where($cond)->count();

        $page = new Page($count, 10);
        $show = $page->show();

        $list = M("member_service_item")->where($cond)->limit($page->firstRow . ',' . $page->listRows)->order('item_id desc')->select();

        $this->assign("page", $show);
        $this->assign("list", $list);
        $this->display();
    }

    public function itemAdd()
    {
        $params = I("get.", "", "");
        if (empty($params)) {
            $type = 'add';
            $this->assign('type', $type);
            return $this->display('itemUpdate');
        }
        if (empty($params['name'])) {
            return $this->my_error("请填写项目名称");
        }
        if (empty($params['service_id'])) {
            return $this->my_error("请选择服务");
        }
        $data['name'] = $params['name'];
        $data['status'] = MemberServiceItemModel::STATUS_ACTIVE;
        $data['service_id'] = $params['service_id'];
        $data['token'] = $this->wxuser['token'];
        $data['fee'] = $params['fee'];
        $data['describe'] = $params['describe'];
        $data['valid_start_date'] = $params['valid_start_date'];
        $data['valid_end_date'] = $params['valid_end_date'];
        $data['is_remind'] = empty($params['is_remind']) ? 0 : $params['is_remind'];
        M("member_service_item")->add($data);
        return $this->my_success("成功");
    }

    public function itemUpdate()
    {
        $type = I("get.type", "", "");
        $itemId = I("get.itemId", "", "");
        if ($type == 'update') {
            $member_service_item = M("member_service_item")->where(['item_id' => $itemId])->find();
            $this->assign("member_service_item", $member_service_item);
            $service_name = '';
            if (!empty($member_service_item)) {
                $cond['service_id'] = $member_service_item['service_id'];
                $service = M("member_service")->where($cond)->find();
                if (!empty($service)) {
                    $service_name = $service['name'];
                }
            }
            $this->assign("service_name", $service_name);
            return $this->display();
        }
        if (empty($itemId)) {
            return $this->my_error("请返回上一页重新选择");
        }
        $params = I("get.", "", "");
        if (empty($params['name'])) {
            return $this->my_error("请填写项目名称");
        }
        if (empty($params['service_id'])) {
            return $this->my_error("请选择服务");
        }
        $data['name'] = $params['name'];
        $data['service_id'] = $params['service_id'];
        $data['token'] = $this->wxuser['token'];
        $data['fee'] = $params['fee'];
        $data['describe'] = $params['describe'];
        $data['valid_start_date'] = $params['valid_start_date'];
        $data['valid_end_date'] = $params['valid_end_date'];
        $data['is_remind'] = empty($params['is_remind']) ? 0 : $params['is_remind'];
        M("member_service_item")->where(['item_id' => $itemId])->save($data);
        return $this->my_success("成功");
    }

    public function itemDelete()
    {
        $itemId = I("get.itemId", "", "");
        $data['status'] = MemberServiceItemModel::STATUS_DELETE;
        if (!empty($itemId)) {
            M("member_service_item")->where(['item_id' => $itemId])->save($data);
        }
        return $this->my_success("成功");
    }

    public function card()
    {
        $cond['status'] = MemberItemCardModel::STATUS_ACTIVE;
        $cond['item_id'] = I("get.itemId");
        if (empty($cond['item_id'])) {
            return $this->redirect("/User/Member/item");
        }
        $count = M("member_item_card")->where($cond)->count();

        $page = new Page($count, 10);
        $show = $page->show();

        $list = M("member_item_card")->where($cond)->limit($page->firstRow . ',' . $page->listRows)->order('card_id desc')->select();
        $this->assign("itemId", $cond['item_id']);
        $this->assign("page", $show);
        $this->assign("list", $list);
        $this->display();
    }

    public function cardAdd()
    {
        $itemId = I("get.itemId", "", "");
        if (empty($itemId)) {
            return $this->redirect("/User/Member/item");
        }
        $item = M("member_service_item")->where(["item_id" => $itemId])->find();
        if (empty($item)) {
            return $this->redirect("/User/Member/item");
        }
        $this->assign("item", $item);
        return $this->display("cardUpdate");
    }

    public function cardUpdate()
    {
        $data['item_id'] = I("get.itemId", "", "");
        if (empty($data['item_id'])) {
            return $this->my_error("请返回服务项目重新选择");
        }
        $data['begin_date'] = I("get.begin_date", "", "");
        $data['end_date'] = I("get.end_date", "", "");
        $data['status'] = MemberItemCardModel::STATUS_ACTIVE;
        $number = I("get.number", "", "");
        if ($number > 5000) {
            return $this->my_error("新建数量不得超过5000");
        }
        $str_pol = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz";
        $max = strlen($str_pol) - 1;
        if ($number > 0) {
            for ($i = 0; $i < $number; $i++) {
                while (true) {
                    $data['cardnumber'] = '';
                    for ($j = 0; $j < 6; $j++) {
                        $data['cardnumber'] .= $str_pol[mt_rand(0, $max)];
                    }
                    $member_item_card = M("member_item_card")->where(['cardnumber' => $data['cardnumber']])->find();
                    if (empty($member_item_card)) {
                        break;
                    }
                }

                M("member_item_card")->add($data);
            }
        }
        return $this->my_success("成功");
    }

    public function cardDelete()
    {
        $cardId = I("get.cardId", "", "");
        $data['status'] = MemberItemCardModel::STATUS_DELETE;
        if (empty($cardId)) {
            M("member_item_card")->where(['card_id' => $cardId])->save($data);
        }
        return $this->my_success("成功");
    }

    private function upload($addSign = '')
    {
        $upload = new \Think\Upload();// 实例化上传类
        $upload->maxSize = 3145728;// 设置附件上传大小
        $upload->exts = array('jpg', 'gif', 'png', 'jpeg');// 设置附件上传类型
        $upload->rootPath = './Public/Uploads/member/'; // 设置附件上传根目录
        $upload->subName = array("date", "Ymd");
        $upload->saveName = array("uniqid", "member");
        // 上传文件
        $info = $upload->upload();
        $img = array();
        if ($info) {
            foreach ($info as $key => $file) {
                $img[$key] = "http://" . $_SERVER["HTTP_HOST"] . '/Public/Uploads/member/' . date('Ymd') . "/" . $file['savename'];
            }
        }
        return $img;
    }
}

?>
